<?php
    session_start();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset='utf-8'>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        <link rel="stylesheet" type="text/css" href="./style.css">
        <script type="text/javascript"
            src="https://maps.googleapis.com/maps/api/js?
                 key=AIzaSyCsTHUfyC8gRQBvZ3O-SpoFhvKa7OTREwc&sensor=false&language=bg&region=bg&libraries=places">
        </script> 
        <script type="text/javascript" src="./jscript.js"></script>
    </head>
    <body>
        <?php
            if (isset($_SESSION['isadmin']) && $_SESSION['isadmin'] == 'yes') {
                echo '<form method="post" action="logout.php"> <input id="login" type="submit" value="Изход"></button> </form>';
            } else {
                echo '<button id="login" type="button" onclick="loginPrompt()"> Вход </button>';
            }
        ?>
        <h1> Добре дошли на сайта ни! </h1>
        <div id=left>
            <form method="post" action="search.php">
                Търсене <input type="search" size="51" name="search" autocomplete="on" autofocus>
            </form>
            <?php
                if (isset($_SESSION['isadmin']) && $_SESSION['isadmin'] == 'yes') {
                    echo '<a href="./add.php"><button id="add" type="button"> Добави обект </button></a>';
                }
            ?>
        </div>
        <div id="map-canvas"/>
    </body>
</html>